def minStamps(stamps: list[int], amount: int) -> int:
    dp = [-1] * (amount + 1)
    dp[0] = 0
    for i in range(0, amount):
        if dp[i] >= 0:
            for c in stamps:
                if c <= amount - i:
                    s = i + c
                    cnt = dp[i] + 1
                    if dp[s] == -1 or dp[s] > cnt:
                        dp[s] = cnt
    return dp[amount]

# main
stamps, amount = [1, 6, 10], 13
a = minStamps(stamps, amount)
print('最小邮票张数:', a)
